home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-06-01 | 2.0 KB | 62 lines | [TEXT/GEOL] |
- Item 3589703 30-May-90 18:23PDT
-
- From: D2234 Cock, Calvin,PRT
-
- To: MACAPP.TECH$ MacApp Technical
-
- Sub: Re- TEditText Problem
-
- Ken,
-
- I ran into your exact problem. The reason is that the floating
- TDialogTTEView that is magically put over your TEditText and TNumberText fields
- DOES NOT INCLUDE YOUR VIEW IN THE DoKeyCommand CHAIN ANYMORE. What you have to
- do is add the following method to each of the views that you wish to filter
- keystrokes for.
-
- PROCEDURE TYourEditText.KeyEventToComponents(VAR info: EventInfo); OVERRIDE;
-
-
- If you do not want any characters to appear in your TextEdit fields the
- following should work. ( no guarantees! )
-
- PROCEDURE TYourEditText.KeyEventToComponents(VAR info: EventInfo); OVERRIDE;
-
-
- BEGIN
- IF (fTEView <> NIL) THEN
- BEGIN
- WITH info, thePEvent^ DO
- BEGIN
- IF (what = keyDown) | (what = autoKey) THEN
- BEGIN
- { Default extractions }
- theCharacter := chr(BAND(message, charCodeMask));
- theKeycode := BSR(BAND(message, keyCodeMask), 8);
-
- { Save the character typed here if you wish }
-
- { Clear out all traces of the key pressed }
- theCharacter := chr ( 00 );
- theKeyCode := 0;
- message := 0;
- END;
- END;
- IF fNextHandler <> NIL THEN
- fNextHandler.KeyEventToComponents(info)
- END;
- END;
-
- Although you are programming in C++ (My condolences) I think you can get
- the gist of the matter from the above. I don't even know how to spell Cee.
-
- I was real miffed when I found out my view was not in the DoKeyCommand
- chain anymore. I think that the view should have a chance at handling the keys
- without having to resort to fiddling with the event records.
-
- Good Luck
-
- Calvin (AKA "Earnie") Cock
-
-
-